-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add powershell autocompletion script generation #420
base: master
Are you sure you want to change the base?
Conversation
Thanks for the contribution. I'll test this out soon. |
I gave it a go on a unix system. Thanks again for putting in the time. It looks like it's functioning ok, but I found a few quirks. I'm not on windows though, so your experience might be different. Tab completions would always start with Options don't show their hyphens at the start. It looks like you've done this intentionally with a trim, but it strikes me as odd. Option completion doesn't give a trailing space if the word is actually complete. I can't seem to get it to show the tooltip. Again, maybe this is just the unix version. |
Thanks for testing my code!
Do you mean that $ foo [TAB] results in
Indeed, I did it on purpose; though I do not have a really strong opinion on this, just a matter of taste. I can remove the trimming.
What's the scenario here? $ foo --full-option[TAB] should append a space, if I understand correctly?
This most probably comes from the default settings of the |
Indeed, I observe the same problem with subcommands, I'll look into it. Regarding the space after trying to complete an already complete word, we can fix that by artificially appending a space to the completion result. |
@HuwCampbell : Looks like @ShrykeWindgrace has pushed an update and waits for a re-review, or maybe I am misinterpreting the log here? (Just passing by...) |
@andreasabel Indeed, thanks for bumping the thread, I myself forgot about this PR =) |
For me, getting auto-completion for free was the killer argument to adopt |
Yep, sorry I haven't been too on the spot for this one. The completion scripts have a tendancy of being really subtle. I remember when I was improving the completion scripts for 0.14 I was refining and manually testing for days (it was for fish, zsh, and bash though). I'll take another look. |
@HuwCampbell Hi! It's been quite a while since the inception of this PR and since the last interaction in this thread. So if it is indeed the case, could you give a rough estimation whether you'll have time for this in the foreseeable future? This PR is not a blocking feature for me, but I would welcome some new info. Cheers! |
Friendly ping =) |
- add note on `PSReadline` settings in order to get tooltips - do not trim dashes in option names - fix command index if we are completing an "empty word" - add space if we are trying to complete a full word
Hi. I've just rebased this. The only issue major I can see at the moment is that when completing files, if you go to complete a directory it adds it withough the trailing slash. To get to a file within, you have to backspace, then add the slash, and then tab again from there instead of it adding it automatically. |
This almost completely addresses issue #315. I leverage the same mechanism as other completion scripts. There are some quirks however:
foo.exe
, notfoo
. I mention this in updated Readme. I will investigate the problem further, maybe it is safe to strip trailling.exe
.foo --
. This is a known issue, and it will not be fixed. Powershell-7 has no such limitations.A review of my code and readme wording is most welcome!